package com.znjc.device.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;

/**
 * 设备数据值
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("iot_device_data")
public class DeviceData {
    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 数据ids
     */
    private Timestamp ts;
    /**
     * 设备id
     */
    private Long deviceId;
    /**
     * 设备名称
     */
    @TableField(exist = false)
    private String deviceName;
    /**
     * 设备编码
     */
    @TableField(exist = false)
    private String deviceCode;
    /**
     * 测点id
     */
    private Long pointId;
    /**
     * 测点名称
     */
    @TableField(exist = false)
    private String pointName;
    /**
     * 测点编码
     */
    @TableField(exist = false)
    private String pointCode;

    /**
     * 实际值
     */
    private String actualValue;
    /**
     * 换算值
     */
    private String equivalentValue;
    /**
     * 规则
     */
    private String rules;

    /**
     * 运算符 数据字典 operator_unit
     */
    private String operatorUnit;
    /**
     * 数据单位
     */
    private String dataUnit;

    @TableField(exist = false)
    private DevicePoint point;
    @TableField(exist = false)
    private DeviceDevice device;

    /**
     *  0正常，1告警
     */
    private Integer alarmType;
    /**
     * 地址位号
     */
    private String address;

}
